package com.scnu.common.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * 业务异常基类
 *
 */
@Getter
@Setter
public class BaseException extends RuntimeException
{

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误提示
     */
    private String message;

    //需要在服务端显示的错误信息
    private Throwable throwable;


    /**
     * 空构造方法，避免反序列化问题
     */
    public BaseException()
    {
    }

    public BaseException(String message)
    {
        this.message = message;
    }
    public BaseException(String message, Throwable throwable, Integer code)
    {
        this.message = message;
        this.code = code;
        this.throwable = throwable;
    }
    public BaseException(Throwable throwable, Integer code)
    {
        this.code = code;
        this.throwable = throwable;
    }

    public BaseException(String message, Integer code)
    {
        this.message = message;
        this.code = code;
    }



}